package com.online.fund.spider.constant;

/**
 * 行业
 * @author galen.zhang
 *
 */
public enum IndustryEnum {

	AGRICULTURE_FISHERY("A","农、林、牧、渔业"),
	MINING_INDUSTRY("B","采矿业"),
	MANUFACTURING_INDUSTRY("C","制造业"),
	POWER_SUPPLY("D","电力、热力、燃气及水生产和供应业"),
	CONSTRUCTION_INDUSTRY("E","建筑业"),
	WHOLESALE_RETAIL_TRADE("F","批发和零售业"),
	TRANSPORTATION_POSTAL_SERVICES("G","交通运输、仓储和邮政业"),
	ACCOMMODATION_CATERING_INDUSTRY("H","住宿和餐饮业"),
	INFORMATION_TRANSMISSION_INFORMATION_TECHNOLOGY_SERVICES("I","信息传输、软件和信息技术服务业"),
	FINANCIAL_INDUSTRY("J","金融业"),
	REAL_ESTATE("K","房地产业"),
	LEASING_BUSINESS_SERVICES("L","租赁和商务服务业"),
	SCIENTIFIC_RESEARCH_TECHNICAL_SERVICES("M","科学研究和技术服务业"),
	WATER_PUBLIC_FACILITIES_MANAGEMENT("N","水利、环境和公共设施管理业"),
	RESIDENTS_SERVICES_OTHER_SERVICES("O","居民服务、修理和其他服务业"),
	EDUCATION_INDUSTRY("P","教育"),
	HEALTH_SOCIAL_WORK("Q","卫生和社会工作"),
	CULTURE_SPORTS_ENTERTAINMENT_INDUSTRY("R","文化、体育和娱乐业"),
	COMPREHENSIVE("S","综合");
	
	private String code;
	private String name;
	
	private IndustryEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
	
	public IndustryEnum getIndustryEnumByName(String name) {
		for (IndustryEnum industryEnum : IndustryEnum.values()) {
			if (industryEnum.getName().equals(name)) {
				return industryEnum;
			}
		}
		
		return null;
	}
	
	public IndustryEnum getIndustryEnumByCode(String code) {
		for (IndustryEnum industryEnum : IndustryEnum.values()) {
			if (industryEnum.getCode().equals(code)) {
				return industryEnum;
			}
		}
		
		return null;
	}
}
